<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"  isELIgnored="false"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
    <title>增加商品资料</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="stylesheet" type="text/css" href="css/fabusp.css" />
    <script>
    function addt() {
    	var cla_id = $("#cla_id").val();
    	var cla_name = $("#cla_name").val();
    	if("" == cla_name)
    		{
    		alert("班级名称不能为空");
    		return false;
    		}
    	else if("" == cla_id)
    		{
    		alert("班级编号不能为空");
    		return false;
    		}
    	$.ajax({
    		type :"POST",
    		   url : "AddClass",
    		   dataType :"json",           
    		   async : false,
    		   data : {
    			   "cla_id" : cla_id,
    			   "cla_name" : cla_name,
    		   },
    		   success:function(data){
    			   $('#cla_name').val(""); 
    			   $('#cla_id').val(""); 
    			   alert(data[0].waring);
    		   },
    		   error:function(data){
    			   $('#cla_name').val(""); 
    			   $('#cla_id').val(""); 
    			   alert("返回数据失败");
    		   }
    	});
    }
    </script>
</head>
<body bgcolor="#fcfcfc" style='background-image:url(../../images/bg.jpg) ;background-repeat:no-repeat ;
background-size:100% 100%;
background-attachment: fixed;'>



    <div class="main">
            <table width="420" border="0" align="left" cellpadding="0" cellspacing="0" id="tabcss">
				<tr>
					<td><b>班级信息录入</b></td>
				</tr>
				<tr>
                    <td width="381">
                        班级编号
                        <input type="text" id="cla_id" id="spmc" size="36" placeholder="请输入班级编号">
                    </td>
                </tr>
                <tr>
                    <td width="381">
                        班级名称
                        <input type="text" id="cla_name" id="spmc" size="36" placeholder="请输入班级名称">
                    </td>
                </tr>
                <tr>
                    <td height="40" colspan="2">
                    <input type="button" value = "提交" class = "button" onclick = "addt()"/></td>
                </tr>
            </table>
    </div>
</body>

</html>
<script src="http://libs.baidu.com/jquery/2.1.4/jquery.min.js"></script>


